import { formatDate } from "./index";
const projectName = "vite";

function getTime() {
  return formatDate(new Date(), 'yyyy-MM-dd EEE HH:mm:ss.S');
}

function formatMsg(message:string) {
  return `[${getTime()}] ` + message;
}

export function log(message: string, ...rest: any[]) {
  console.log(formatMsg(message), ...rest);
}

export function warn(message: string) {
  console.warn(`[${projectName} warn]:${message}`);
}

export function error(message: string) {
  throw new Error(`[${projectName} error]:${message}`);
}
